<cfapplication clientmanagement="yes" sessionmanagement="yes" name="ds">
<!--- simple auth --->
<cfif isdefined('password') and password is 'kha350'>
<cfquery  datasource="101tf2" name="getSec">
insert into scanAccess   (ip) values ('#cgi.REMOTE_ADDR#')
</cfquery>
</cfif>
<cfquery  datasource="101tf2" name="getSec">
select ip from scanAccess where ip = '#cgi.REMOTE_ADDR#'
</cfquery>
<cfif not getSec.recordcount>
<form method="post"><input type="password" name="password" />
<input type="submit" name="s" value="ok" />
</form>
<cfabort>
</cfif>
<!--- Config Data ... should be fixed soon --->
<cfset progressWidth=7.97>
<cfset VideoThumbPath='#ExpandPath("/")#Thumbnails\Video\'>
<cfset VideoThumbURL='/Thumbnails/Video/'>
<cfset NumberOfVideoThumbNails=5>

<cfset mapping['y:\']="\\tar\t2\">
<cfset mapping['z:\']="\\tar\t1\">
<cfset mapping['w:\']="\\abc\e$\">
<cfset mapping['u:\']="\\abc\g$\">
<cfset mapping['v:\']="\\abc\f$\">
<cfset mapping['x:\']="\\abc\c$\Documents and Settings\user\My Documents\My Pictures\">
<cfset mapping['s:\']="\\HTPC\c$\Program Files\Hauppauge\WinTV Nexus\record\">
<cfset ConvertedVideo="#ExpandPath("/")#ConvertedVideo\">

<cfscript>
/**
* Checks if a file can be read.
*
* @param filename      The file to check. (Optional)
* @return Returns a boolean.
* @author Jesse Houwing (j.houwing@student.utwente.nl)
* @version 1, November 14, 2002
*/
function FileCanRead(filename){
    var daFile = createObject("java", "java.io.File");
    daFile.init(JavaCast("string", filename));
    return daFile.canRead();
}

/**
* Calls both DateFormat and TimeFormat on a data object.
*
* @param time      A data object.
* @param dateFormat      The string to use to format dates. Defaults to
* @param timeFormat      The string to use to format time. Defaults to
* @param joinStr      This string is placed between the date and time. Defaults to one space character.
* @return This function returns a string.
* @author Raymond Camden (ray@camdenfamily.com)
* @version 1, November 26, 2001
*/
function DateTimeFormat(time) {
    var str = "";
    var dateFormat = "mmmm d, yyyy";
    var timeFormat = "h:mm tt";
    var joinStr = " ";
    
    if(ArrayLen(Arguments) gte 2) dateFormat = Arguments[2];
    if(ArrayLen(Arguments) gte 3) timeFormat = Arguments[3];
    if(ArrayLen(Arguments) gte 4) joinStr = Arguments[4];

    return DateFormat(time, dateFormat) & joinStr & TimeFormat(time, timeFormat);
}

/**
* Pass in a value in bytes, and this function converts it to a human-readable format of bytes, KB, MB, or GB.
* Updated from Nat Papovich's version.
* 01/2002 - Optional Units added by Sierra Bufe (sierra@brighterfusion.com)
*
* @param size      Size to convert.
* @param unit      Unit to return results in. Valid options are bytes,KB,MB,GB.
* @return Returns a string.
* @author Paul Mone (sierra@brighterfusion.compaul@ninthlink.com)
* @version 2.1, January 7, 2002
*/
function byteConvert(num) {
    var result = 0;
    var unit = "";
    
    // Set unit variables for convenience
    var bytes = 1;
    var kb = 1024;
    var mb = 1048576;
    var gb = 1073741824;

    // Check for non-numeric or negative num argument
    if (not isNumeric(num) OR num LT 0)
        return "Invalid size argument";
    
    // Check to see if unit was passed in, and if it is valid
    if ((ArrayLen(Arguments) GT 1)
        AND ("bytes,KB,MB,GB" contains Arguments[2]))
    {
        unit = Arguments[2];
    // If not, set unit depending on the size of num
    } else {
         if (num lt kb) {    unit ="bytes";
        } else if (num lt mb) {    unit ="KB";
        } else if (num lt gb) {    unit ="MB";
        } else {    unit ="GB";
        }        
    }
    
    // Find the result by dividing num by the number represented by the unit
    result = num / Evaluate(unit);
    
    // Format the result
    if (result lt 10)
    {
        result = NumberFormat(Round(result * 100) / 100,"0.00");
    } else if (result lt 100) {
        result = NumberFormat(Round(result * 10) / 10,"90.0");
    } else {
        result = Round(result);
    }
    // Concatenate result and unit together for the return value
    return (result & " " & unit);
}
</cfscript>